﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using Maticsoft.DBUtility;
using System.Collections;

namespace BLL
{
    class GuessWordCache
    {
        private static GuessWordCache instance;
        private DataSet guessWordDataSet=new DataSet();
        private DateTime refreshTime;

        public DateTime RefreshTime
        {
            get { return refreshTime; }
            
        }
        
        public DataSet GuessWordDataSet
        {
            get { return guessWordDataSet; }
            set { guessWordDataSet = value; }
        }
        private GuessWordCache()
        {
            RefreshDB();
            
        }

        public void RefreshDB()
        {
            lock (guessWordDataSet)
            {
                guessWordDataSet = DbHelperOra.Query("select * from search_guessword");
                refreshTime = DateTime.Now;
            }
        }

        public static GuessWordCache GetInstance()
        {
            if (instance == null)
            {
                instance = new GuessWordCache();
            }
            return instance;
            
        }


    }
}
